package jdbc;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBCDemo5 {
    public static void main(String[] args) {
        try(Connection connection = DBUtil.getConnection()){
            Statement statement = connection.createStatement();
            String sql = "SELECT * FROM userinfo;";
            ResultSet rs =statement.executeQuery(sql);
            while(rs.next()){
                System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3)+" "+rs.getString(4)+" "+rs.getString(5));
            }
        }catch(SQLException e){
            throw new RuntimeException(e);
        }
    }
}
